﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;

namespace Social.Core.Protocols
{
    /// <summary>
    /// Provides funcionality that the social protocol must implement
    /// </summary>
    public interface IProtocol
    {
        /// <summary>
        /// Executes an HttpRequest request
        /// </summary>
        /// <param name="url">url to request</param>
        /// <returns>result of the request</returns>
        string DoRequest(string url);
        
        /// <summary>
        /// Executes an HttpRequest request with the http verb as parameter
        /// </summary>
        /// <param name="url">url to request</param>
        /// <param name="method">Request Method type</param>
        /// <returns>request result</returns>
        string DoRequest(string url, String method);
       
        /// <summary>
        /// Executes a HttpRequest with credentials information
        /// </summary>
        /// <param name="url">url to request</param>
        /// <param name="credentials">Credentials to use</param>
        /// <returns>request result</returns>
        string DoRequest(string url, ICredentials credentials);

        /// <summary>
        /// Executes a HttpRequest with http verb and credentials information
        /// </summary>
        /// <param name="url">url to request</param>
        /// <param name="method">Request method type</param>
        /// <param name="credentials">Credentials to use</param>
        /// <returns>request result</returns>
        string DoRequest(string url, String method, ICredentials credentials);

        /// <summary>
        /// Makes the Authorization Request 
        /// </summary>
        /// <param name="objectId">object to wicth will request authorization for</param>
        /// <param name="args">collection or especific protocol arguments</param>
        void AuthorizationRequest(string objectId, AuthorizationRequestArgs args);

        /// <summary>
        /// Request for credentials based on is information
        /// </summary>
        /// <param name="clientAccessTokenTokenName">client identification</param>
        /// <param name="credentials">collection or especific protocol arguments</param>
        /// <returns> result of the request for credentials </returns>
        string ClientCredentialsRequest(string clientAccessTokenTokenName, ClientCredentials credentials);

        /// <summary>
        /// Gets or Sets the Url to be used in the negotiation protocol  
        /// </summary>
        String ClientCredentialsUrlRequest { get; set; }
    }

}
